<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<c:set var="flg" value="false" />
<script type="text/javascript">
var powerCode="${powerCode}";
var toolbar=[
<c:forEach items="${powers}" var="p"  varStatus="sta">
	<c:if test="${fn:containsIgnoreCase(p.position,'top')}">
		<c:if test="${flg}">,"-",</c:if>
		{
			text:"${p.powerName}",
			iconCls:"${p.iconCls}",
			handler:${p.url}
		}
		<c:set value="true" var="flg" />
	</c:if>
</c:forEach>
];

<c:set value="false" var="flg" />
function operateFunction(value,row,index){
	var html="";
	<c:forEach items="${powers}" var="p"  varStatus="sta">
		<c:if test="${fn:containsIgnoreCase(p.position,'middle')}">
			<shiro:hasPermission name="${p.masterName}">
				<c:if test="${flg}">html+=" | ";</c:if>
				html+="<span class='span_a' onclick='javascript:${p.url}(\""+row.id+"\");'>${p.powerName}</span>";
				<c:set value="true" var="flg" />
			</shiro:hasPermission>
		</c:if>
	</c:forEach>
	return html;
}
</script>
